<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>
<portlet:defineObjects/>

    <script src="http://www.google.com/jsapi?key=<c:out value="${KEY}"/>" type="text/javascript"></script>
    <script language="Javascript" type="text/javascript">
    //<![CDATA[
      google.load('search', '1.0');
      
      function <portlet:namespace/>OnLoad() {

        // create a tabbed mode search control
        var tabbed = new google.search.SearchControl();
		var options = new google.search.SearcherOptions();
		options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
        var drawOptions = new google.search.DrawOptions();
        drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);

		// add the web search
        tabbed.addSearcher(new google.search.WebSearch(), options);

        tabbed.draw(document.getElementById("<portlet:namespace/>searchcontrol"), drawOptions);

      }
      google.setOnLoadCallback(<portlet:namespace/>OnLoad, true);

    //]]>
    </script>
    <div id="<portlet:namespace/>searchcontrol">Loading...</div>
